package com.yamaikeji.system.service.impl.tts;

import java.util.List;
import com.yamaikeji.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yamaikeji.system.mapper.tts.ActivationMapper;
import com.yamaikeji.system.domain.tts.Activation;
import com.yamaikeji.system.service.tts.IActivationService;

/**
 * 激活码Service业务层处理
 * 
 * @author yamaikeji
 * @date 2025-04-08
 */
@Service
public class ActivationServiceImpl implements IActivationService {

    @Autowired
    private ActivationMapper activationMapper;

    /**
     * 查询激活码列表
     *
     * @param activation 激活码
     * @return 激活码
     */
    @Override
    public List<Activation> selectActivationList(Activation activation) {
        return activationMapper.selectActivationList(activation);
    }

    /**
     * 查询激活码
     * 
     * @param activation 激活码
     * @return 激活码
     */
    @Override
    public Activation selectActivation(Activation activation) {
        return activationMapper.selectActivation(activation);
    }

    /**
     * 新增激活码
     * 
     * @param activation 激活码
     * @return 结果
     */
    @Override
    public int insertActivation(Activation activation) {
        activation.setCreateTime(DateUtils.getNowDate());
        return activationMapper.insertActivation(activation);
    }

    /**
     * 修改激活码
     * 
     * @param activation 激活码
     * @return 结果
     */
    @Override
    public int updateActivation(Activation activation) {
        activation.setUpdateTime(DateUtils.getNowDate());
        return activationMapper.updateActivation(activation);
    }

    /**
     * 删除激活码
     * 
     * @param activation 激活码
     * @return 结果
     */
    public int deleteActivation(Activation activation) {
        return activationMapper.deleteActivation(activation);
    }
}
